package com.xiaoyu.client.ui.dialog;

import android.graphics.drawable.BitmapDrawable;
import android.view.WindowManager;
import android.widget.PopupWindow;

public class DialogUtils {
    //显示ScheduleMenuPow ----- PopupWindow
    public static void showSchedulePow(PopupWindow popupWindow) {
        popupWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
        setNature(popupWindow);
    }

    public static void setNature(PopupWindow popupWindow) {
        popupWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
        popupWindow.setFocusable(true);
        // 需要设置一下此参数，点击外边可消失
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        //设置点击窗口外边窗口消失

        popupWindow.setOutsideTouchable(true);

        //华为手机软件盘
        popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    }
}
